// Angular component that can be used in AngularJS templates
import { Component, Input, output } from "@angular/core";
import { downgradeComponent } from "@angular/upgrade/static";

@Component({
  standalone: true,
  selector: "ngx-example",
  template: "<h1>{{ title }}</h1>",
})
export class ExampleComponent {
  @Input() title!: string;

  titleWrapper = output<string>();

  updateTitle(newName: string): void {
    this.titleWrapper.emit(newName);
  }
}

// Downgrade for use in AngularJS
// angular
//   .module("root")
//   .directive("ngxExample", downgradeComponent({ component: ExampleComponent }));
